package Test2;

import java.util.Scanner;

public class MainApp {
    public static void main(String[] args) {
        System.out.println("输入学员编号:");
        Scanner sc = new Scanner(System.in);
        System.out.println("C:\\>请输入学员编号：");
        String id = sc.nextLine();

        System.out.println("C:\\>请输入学员姓名：");
        String name = sc.nextLine();

        System.out.println("C:\\>请输入学员性别：");
        String gender = sc.nextLine();

        System.out.println("C:\\>请输入学员身高：");
        double high = sc.nextDouble();

        System.out.println("C:\\>请输入学员年龄：");
        int age = sc.nextInt();
//无参构造法
        Student student = new Student();
        student.setId(id);
        student.setName(name);
        student.setGender(gender);
        student.setHigh(high);
        student.setAge(age);
        // 创建 Student 对象，通过全参构造方法存储数据
        //Student student = new Student(studentId, name, gender, height, age);

        // 打印对象中的每个属性值
        System.out.println("学员信息如下：");
       student.printStudentInfo();

        sc.close();
    }
}

